package com.wang.employeemanager;

import java.util.Objects;

public class Employee {
    private int jobNum;
    private String name;
    private int age;
    private double salary;

    public Employee() {
    }

    public Employee(int jobNum, String name, int age, double salary) {
        this.jobNum = jobNum;
        this.name = name;
        this.age = age;
        this.salary = salary;
    }

    public int getJobNum() {
        return jobNum;
    }

    public void setJobNum(int jobNum) {
        this.jobNum = jobNum;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public void work(){
        System.out.println(name + "正在工作...");
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return jobNum == employee.jobNum && Objects.equals(name, employee.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(jobNum, name);
    }
}
